(DEFUN C:tally ()
  (IF attupd nil (LOAD "attupd" "\nFile ATTUPD.LSP not loaded! "))
  (SETQ tally_str
        (STRCAT 
          "%<\\AcSm Sheet.Number \\f \"%tc1\">%";Sheet Number
          " of "
          "%<\\AcSm SheetSet.Sheet Total \\f \"%tc1\">%";Sheet total (custom field "Sheet Total" is required)
        )
  )
  (attupd "corpttbats" "SHT_SERIES_TXT" tally_str)
  (command "updatefield" (ssget "x" '((2 . "corpttbats"))) "")
  (PRINC)
)